﻿<UserControl x:Class="ContactTracing.CaseView.Controls.UnexplainedBleeding"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:p="clr-namespace:ContactTracing.CaseView.Properties"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="700">
    <Grid>
        <Grid.Background>
            <SolidColorBrush Color="Black" Opacity="0.4" />
        </Grid.Background>

        <Border HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="1" BorderBrush="{StaticResource HighlightBrush}">
            <Grid Width="Auto" Height="Auto" Background="{StaticResource LightBackgroundBrush}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <StackPanel Margin="20">

                    <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />

                    <TextBlock Style="{StaticResource Heading1}">UNEXPLAINED BLEEDING</TextBlock>

                    <StackPanel Height="20" />

                    <Grid Margin="10, 0, 0, 0" Grid.Column="2">
                        <Grid.Resources>
                            <Style TargetType="TextBlock">
                                <Setter Property="Margin" Value="0, 0, 6, 3" />
                            </Style>
                            
                            <Style TargetType="CheckBox">
                                <Setter Property="Margin" Value="0, 0, 6, 0" />
                            </Style>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <TextBlock   Grid.Row="2" Text="{x:Static p:Resources.PrintedFormSymptomBleedGums}" />
                        <TextBlock  Grid.Row="3" Text="{x:Static p:Resources.PrintedFormSymptomBleedSite}" />
                        <TextBlock  Grid.Row="4" Text="{x:Static p:Resources.PrintedFormSymptomBleedNose}" />
                        <TextBlock  Grid.Row="5" Text="{x:Static p:Resources.PrintedFormSymptomBloodyStool}" />
                        <TextBlock  Grid.Row="6" Text="{x:Static p:Resources.PrintedFormSymptomBloodyVomit}" />
                        <TextBlock  Grid.Row="7" Text="{x:Static p:Resources.PrintedFormSymptomDigestedBloodVomit}" />
                        <TextBlock  Grid.Row="8" Text="{x:Static p:Resources.PrintedFormSymptomHemoptysis}" />
                        <TextBlock  Grid.Row="9" Text="{x:Static p:Resources.PrintedFormSymptomBleedVagina}" />
                        <TextBlock  Grid.Row="10" Text="{x:Static p:Resources.PrintedFormSymptomBruising}" />
                        <TextBlock  Grid.Row="11" Text="{x:Static p:Resources.PrintedFormSymptomHematuria}" />
                        <TextBlock  Grid.Row="12" Text="{x:Static p:Resources.PrintedFormSymptomOtherHemorrhagic}" />
                        
                        
                        <StackPanel Orientation="Horizontal" Grid.Row="13" Grid.ColumnSpan="3">
                            <TextBlock Margin="35, 0, 5, 5">
                                                    <Run FontStyle="Italic" Text="{x:Static p:Resources.PrintedFormIfYes}" />
                                                    <Run Text="{x:Static p:Resources.PrintedFormPleaseSpecify}" />
                            </TextBlock>

                            <TextBox Width="180" x:Name="txtBleedOtherComment" 
                                                 IsEnabled="{Binding ElementName=cOtherHemorrhagicY, Path=IsChecked}"
                                    Text="{Binding SymptomOtherHemoSpecify, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                            <ComboBox x:Name="cmbBleedOtherComment" 
                                Width="120" 
                                IsEditable="True" 
                                IsEnabled="{Binding ElementName=cOtherHemorrhagicY, Path=IsChecked}"
                                VerticalAlignment="Center" 
                                ItemsSource="{Binding RelativeSource={RelativeSource
                                Mode=FindAncestor,
                                AncestorType={x:Type Window}},
                                Path=DataContext.BleedOtherComments}" 
                                LostFocus="cmbBleedOtherComment_LostFocus"
                                Text="{Binding SymptomOtherHemoSpecify, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True}" />
                        </StackPanel>
                        <!--<TextBlock Grid.Row="14" FontWeight="Bold" Text="{x:Static p:Resources.PrintedFormSymptomOtherNonHemorrhagic}" />
                        <StackPanel Orientation="Horizontal" Grid.Row="15" Grid.ColumnSpan="3">
                            <TextBlock Margin="35, 0, 5, 5">
                                                    <Run FontStyle="Italic" Text="{x:Static p:Resources.PrintedFormIfYes}" />
                                                    <Run Text="{x:Static p:Resources.PrintedFormPleaseSpecify}" />
                            </TextBlock>

                            <TextBox Width="180" x:Name="txtUnexBleedSpecify" 
                                                 IsEnabled="{Binding ElementName=cOtherNonHemorrhagicY, Path=IsChecked}"
                                    Text="{Binding SymptomOtherNonHemorrhagicSpecify, UpdateSourceTrigger=PropertyChanged}" />
                        </StackPanel>-->

                        <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="1"
                                                    IsEnabled="{Binding UnexplainedBleeding, Converter={StaticResource YesToEnabledConverter}}">
                            <CheckBox x:Name="cBleedGumsY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomBleedGums, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cBleedGumsN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomBleedGums, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cBleedGumsU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomBleedGums, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cBleedInjectionSiteY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomBleedInjectionSite, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cBleedInjectionSiteN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomBleedInjectionSite, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cBleedInjectionSiteU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomBleedInjectionSite, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cNoseBleedY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomNoseBleed, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cNoseBleedN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomNoseBleed, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cNoseBleedU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomNoseBleed, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="5" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cBloodyStoolY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomBloodyStool, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cBloodyStoolN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomBloodyStool, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cBloodyStoolU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomBloodyStool, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cBloodVomitY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomHematemesis, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cBloodVomitN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomHematemesis, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cBloodVomitU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomHematemesis, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="7" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cDigestedBloodY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomBloodVomit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cDigestedBloodN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomBloodVomit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cDigestedBloodU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomBloodVomit, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="8" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cCoughBloodY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomCoughBlood, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cCoughBloodN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomCoughBlood, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cCoughBloodU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomCoughBlood, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="9" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cBleedVaginaY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomBleedVagina, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" IsEnabled="{Binding Sex, Converter={StaticResource NoToEnabledConverter}}" />
                            <CheckBox x:Name="cBleedVaginaN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomBleedVagina, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" IsEnabled="{Binding Sex, Converter={StaticResource NoToEnabledConverter}}" />
                            <CheckBox x:Name="cBleedVaginaU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomBleedVagina, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" IsEnabled="{Binding Sex, Converter={StaticResource NoToEnabledConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="10" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cBruisingY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomBleedSkin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cBruisingN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomBleedSkin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cBruisingU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomBleedSkin, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="11" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cBloodInUrineY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomBleedUrine, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cBloodInUrineN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomBleedUrine, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cBloodInUrineU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomBleedUrine, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <StackPanel Orientation="Horizontal" Grid.Row="12" Grid.Column="1"
                                                    IsEnabled="{Binding ElementName=cBleedUnexplainedY, Path=IsChecked}">
                            <CheckBox x:Name="cOtherHemorrhagicY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomOtherHemo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cOtherHemorrhagicN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomOtherHemo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cOtherHemorrhagicU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomOtherHemo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>

                        <!--<StackPanel Orientation="Horizontal" Grid.Row="14" Grid.Column="1">
                            <CheckBox x:Name="cOtherNonHemorrhagicY" Content="{x:Static p:Resources.Yes}" IsChecked="{Binding SymptomOtherNonHemorrhagic, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource YesToCheckedConverter}}" />
                            <CheckBox x:Name="cOtherNonHemorrhagicN" Content="{x:Static p:Resources.No}" IsChecked="{Binding SymptomOtherNonHemorrhagic, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NoToCheckedConverter}}" />
                            <CheckBox x:Name="cOtherNonHemorrhagicU" Content="{x:Static p:Resources.PrintedFormUnknown}" IsChecked="{Binding SymptomOtherNonHemorrhagic, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource UnknownToCheckedConverter}}" />
                        </StackPanel>-->
                    </Grid>

                    <StackPanel Height="20" />

                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button
                                    Content="Close"
                                    Command="{Binding ToggleBleedingDisplayCommand}"
                                    Width="90" Margin="0, 0, 0, 0" />
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
